<%-- 
    Document   : InsertarNota
    Created on : 29/10/2011, 09:34:59 AM
    Author     : rchic
--%>

<%@page import="PaquetesJL.*" %>
<%@page import="java.sql.ResultSet" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body>
<%
         String cuenta=request.getParameter("cuenta");
         int id_cuenta=Integer.parseInt(cuenta);
         String descrip_error=request.getParameter("error");
         
    String sqlServer = pageContext.getServletContext().getInitParameter("sqlServer");
    String databaseName = pageContext.getServletContext().getInitParameter("databaseName");
    String userName = pageContext.getServletContext().getInitParameter("userName");
    String PasswordP = pageContext.getServletContext().getInitParameter("password");
    String Backup = pageContext.getServletContext().getInitParameter("RutaBackup");
    
        byte[] decodedBytes = ConexionBD.decode(PasswordP);
    String decodedPassword = new String(decodedBytes).trim();
    ConexionBD Conexion;
        ResultSet r;
                Conexion = new ConexionBD(sqlServer, databaseName, userName, decodedPassword, Backup);
            Conexion.IniciarConexion();
            r=Conexion.EjecutarConsulta("EXEC dbo.NotaDeb-Cre "+id_cuenta +",'"+ descrip_error+"';");
                  
            if(r.next()){
                out.print(r.getString(1));
            }
 
            out.println("insercion con exito"+r);
            Conexion.CerrarConexion();

%>        
        

    </body>
</html>
